package com.csmzxy.web.api;

import com.csmzxy.model.User;

import com.csmzxy.service.UserService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * Created by Administrator on 2018/8/28. ,produces = "text/html;charset=UTF-8
 */
@Controller
@RequestMapping(value = "/api/user/")
//@Slf4j
public class UserController  {

    @Autowired
    UserService userService;

    @RequestMapping(value = "/add", method = RequestMethod.GET)
    public @ResponseBody User findUserById(@RequestParam("id") String id) {

        System.out.println("aaaa");
//        HttpServletResponse httpServletResponse = new HttpServletResponse();
        User user = userService.findUserById(id);
//        return wrapperJsonView(user);
        return user;
    }
}